Skip to content

Add Share Thread feature + Charts export fixes#409

Open
ankit-thesys wants to merge 6 commits intothesysdev:mainfrom
ankit-thesys:nit/react-ui
Open

Add Share Thread feature + Charts export fixes#409
ankit-thesys wants to merge 6 commits intothesysdev:mainfrom
ankit-thesys:nit/react-ui

Conversation

@ankit-thesys
Copy link
Copy Markdown
Contributor

Summary

  • Share Thread feature: Adds generateShareLink prop to FullScreen, Copilot, and BottomTray composed chat variants. When provided, a share button appears in the header that opens a modal for generating and copying a shareable link.
  • Charts export fix: Removes Scrollable* aliases from Charts/index.ts — exports AreaChart, BarChart, LineChart under their original names, matching subpath exports and consumer expectations.
  • Shell Thread fixes: Exports AssistantMessageComponent type, minor fixes to Shell/CopilotShell/BottomTray Thread components.

New files

  • ShareThread.tsx — Share button component (adapts mobile/desktop)
  • ShareThreadModal.tsx — Radix Dialog modal with generate → copy flow
  • useShareThread.ts / useShareMessages.ts — Supporting hooks
  • shareThread.scss — Styles
  • Storybook stories for all 3 variants

New dependency

  • @radix-ui/react-dialog

Test plan

  • pnpm --filter @openuidev/react-ui build passes
  • Storybook: StandaloneWithShareLink, CopilotWithShareLink, BottomTrayWithShareLink stories render correctly
  • Share button hidden when no messages
  • Share button disabled while streaming
  • Modal: Generate link → Copy link → "Copied!" feedback works
  • Charts: AreaChart, BarChart, LineChart importable from both barrel and subpath

🤖 Generated with Claude Code

ankit-thesys and others added 2 commits March 25, 2026 11:53
This commit prepares the OpenUI react-ui package for c1's migration
from @crayonai/react-ui. It adds the Share Thread feature natively
to OpenUI and fixes chart export naming.

Share Thread (new feature):
- Add ShareThread component, ShareThreadModal (Radix Dialog), and
  supporting hooks (useShareThread, useShareMessages)
- Add generateShareLink prop to SharedChatUIProps — when provided,
  a share button appears in the chat header for all three variants
- Wire into FullScreen (MobileHeader + ThreadHeader), Copilot (Header),
  and BottomTray (Header)
- Add @radix-ui/react-dialog dependency
- Add storybook stories for all three variants with share link

Charts exports fix:
- Remove Scrollable* aliases from Charts/index.ts — export AreaChart,
  BarChart, LineChart under their original names (matching subpath
  exports and consumer expectations)
- Fix genui-lib chart condensed imports to use correct paths

Shell Thread fixes:
- Export AssistantMessageComponent type from _shared/types
- Minor fixes to Shell, CopilotShell, BottomTray Thread components

Checkpoint: openui-comp side of c1 migration is complete. The c1 repo
(composition) has separate commits for Phases 1-6 covering the full
migration from @crayonai to @openuidev.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ankit-thesys ankit-thesys requested a review from abhithesys March 28, 2026 11:17
@abhithesys abhithesys changed the title Add Share Thread feature + Charts export fixes for c1 migration Add Share Thread feature + Charts export fixes Mar 28, 2026
ankit-thesys and others added 4 commits March 29, 2026 03:41
Replace generateShareLink((messages) => url) with
generateShareLink((threadId) => url). The consumer's backend
looks up messages by threadId — no need to pass the full message
array client-side.

Changes:
- Delete useShareMessages.ts (message selection no longer needed)
- Rewrite useShareThread.ts to get selectedThreadId from store
- Update ShareThread props and types to (threadId: string)
- Remove Message type import from SharedChatUIProps

This is a cleaner API that avoids message format conversion
concerns and simplifies the hook from ~130 lines to ~28 lines.

Checkpoint: Share Thread feature complete with threadId-based API.
Builds on 8552f33 which added the initial messages-based version.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Introduced `separateContentAndContext` utility to clean user message content by removing XML tags.
- Updated `UserMessageContent` to utilize the new utility for displaying clean text.
- Minor adjustments in the `Table` component to improve column alignment handling and row normalization.
- Expanded `ColSchema` to include an optional `icon` property for better column customization.
- Introduced an `isStreaming` prop in the `MarkDownRenderer` component to enable streaming functionality.
- Updated the `TextContent` component to pass the `isStreaming` state to `MarkDownRenderer`, enhancing its rendering capabilities based on streaming status.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants